﻿using Server.CustomObjects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace Server.Interfaces
{
    interface IDataBase
    {
        DataBase.DBUser User { get; }
        DataBase.DBSession Session { get; }
        DataBase.DBContacts Contacts { get; }
    }

    interface IDataBaseUser
    {
        Int32 verifyUserData(string userName, string password, EndPoint pEndPoint);
        User GetUser(int id);
        User GetUser(String name);
        Boolean updateUser(User user);
        User AddUser(String userName,String Password,String Email = "");
        Boolean RemoveUser(User user);
        long Count();
    }

    interface IDataBaseSession
    {
        Session createSession(int userId);
        Boolean connectUserToSession(int userId, int sessionId);
        Boolean removeUserFromSession(int userId, int sessionId);
        Boolean closeSession(int userId, int sessionId);
        long Count();
    }

    interface IDataBaseContacts
    {

        Boolean RequestFriendship(int pRequesterID, int pTagetUserID);
        Boolean RequestFriendship(User pRequester, int pTagetUserID);
        Boolean RequestFriendship(User pRequester, User pTargetUser);

        Boolean AcceptFriendship(int pAccepterID, int pRequesterID);
        Boolean AcceptFriendship(User pAccepter, int pRequesterID);
        Boolean AcceptFriendship(User pAccepter, User pRequester);

        Boolean DeclineFriendship(int pDeclinerID, int pRequesterID);
        Boolean DeclineFriendship(User pDecliner, int pRequesterID);
        Boolean DeclineFriendship(User pDecliner, User pRequester);

        Boolean CancelFriendship(int pCancelerID, int pExFriendID);
        Boolean CancelFriendship(User pCanceler, int pExFriendID);
        Boolean CancelFriendship(User pCanceler, User pExFriend);

        Boolean UserAllreadyRequested(int pRequesterID, int pTagetUserID);
        Boolean UserAllreadyRequested(User pRequester, int pTagetUser);
        Boolean UserAllreadyRequested(User pRequester, User pTagetUser);

        Boolean UserIsFriend(int pUserID, int pMaybeFriendID);
        Boolean UserIsFriend(User pUser, int pMaybeFriend);
        Boolean UserIsFriend(User pUser, User pMaybeFriend);

        List<User> getUnacceptedFriendRequestForUser(int pUserID);
        List<User> getUnacceptedFriendRequestForUser(User pUser);
        
        List<User> getFriendListForUser(int pUserID);
        List<User> getFriendListForUser(User pUser);

    }
    
}
